/**********************************************************************
 *File		:	key.h
 *Time		:	2023/6/7
 *Author		:	Bryan He（贺璧）
 *Discreption:
 *
 ************************************************************************/

#ifndef KEY_HHHH____
#define KEY_HHHH____

#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "mo_msg.h"



#define GPIO_KEY_MAX         8ul
#define KEY_POLLING_INTERVAL 5u
#define KEY_DEBOUNCE_TIME    (10 / KEY_POLLING_INTERVAL) /*Ms*/

typedef enum {
    EX_IO_VOL_NULL_K = 0,
    EX_IO_BT_KEY = 0X04,
    EX_IO_PLAY_KEY = 0x08,
    EX_IO_VOL_UP_KEY = 0x20,
    EX_IO_VOL_DW_KEY = 0x10,

} EX_IO_KEY_ID;

typedef struct ex_key_infor {
    mo_hw_key_t kcode;
    void *port; /**/
    u16 pin;
} ExKyeInfo;

typedef struct key_task {
    mo_task_data tsk;
    u8 ex_k_cnt[GPIO_KEY_MAX];
    const ExKyeInfo *pKeyTable;
} KEY_TASK_T;



void app_key_task_init(void);

#endif